<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
<h1>项目-购物车</h1>

<script src="./utils.js"></script>
<script>
// 存储当前页面地址
localStorage.setItem('currentUrl',location.href)

// 发送验证是否登录的请求
ajax({
    type: 'get',
    url: 'http://localhost:8080/users/islogin',
    dataType: 'json'
})
.then((res)=>{
    // alert(res.msg)
    if (res.code === 0) {
        // 未登录，跳转到登录页
        location.href = './8-login.html'
    }
})

</script>
</body>
</html>